package com.murray.shop.background.controller;

import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author Murray
 * @Date 2021/8/20
 * @Time 20:41
 */
@RequestMapping(value = "/index")
public class IndexController {

    @RequestMapping(value = "/index")
    public String index(HttpSession session) {
        //如果登录过，访问主页就放行，否则登录
        if (session.getAttribute("admin") != null) {
            return "index";
        }
        return "login";
    }


}
